<%--
  Created by bothin
  At 2019/12/17 9:15
  Description: 
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<form class="layui-form" action="${pageContext.request.contextPath}/product/add?page=${page!=null?page:'1'}" method="post" style="margin-top: 30px;">
    <div class="layui-form-item">
        <label class="layui-form-label">商品名称 *</label>
        <div class="layui-input-inline">
            <input type="text" name="productName" required placeholder="请输入商品名称" value="${product==null?'':product.productName}" autocomplete="off" class="layui-input layui-form-danger">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">商品单价 *</label>
        <div class="layui-input-inline">
            <input type="number" name="productPrice" required placeholder="请输入单价" value="${product==null?'':product.productPrice}" autocomplete="off" class="layui-input layui-form-danger">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">商品库存 *</label>
        <div class="layui-input-inline">
            <input type="number" name="productStock" required placeholder="请输入库存" value="${product==null?'':product.productStock}" autocomplete="off" class="layui-input layui-form-danger">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">图片URL </label>
        <div class="layui-input-inline">
            <input type="text" name="productIcon"  placeholder="请输入图片" value="${product==null?'':product.productIcon}" autocomplete="off" class="layui-input layui-form-danger">
        </div>
    </div>
    <div class="layui-form-item layui-form-text">
        <label class="layui-form-label">商品描述 *</label>
        <div class="layui-input-block">
            <textarea name="productDescription" required placeholder="请输入商品描述" class="layui-textarea"
                style="width: 280px;"
            >${product==null?'':product.productDescription}</textarea>
        </div>
    </div>


    <div class="layui-form-item layui-hide">
        <div class="layui-input-inline">
            <input type="text" name="productId" value="${product==null?'':product.productId}" autocomplete="off" class="layui-input layui-form-danger">
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-input-block" style="margin-left: 143px;">
            <button class="layui-btn" type="submit">立即提交</button>
            <button class="layui-btn layui-btn-primary" type="reset">重置</button>
        </div>
    </div>
</form>

